﻿namespace Socket.Core
{
    using System;
    using System.IO;
    using System.Runtime.CompilerServices;

    public class ReceiveInfo : IDisposable, IReceiveInfo
    {
        public void Dispose()
        {
            if (this.ReceiveStream != null)
            {
                this.ReceiveStream.Close();
                this.ReceiveStream.Dispose();
            }
        }

        public bool IsHeartbeat { get; set; }

        public int MethodCode { get; set; }

        public byte[] ReceiveHead { get; set; }

        public int ReceiveHeadOffset { get; set; }

        public int ReceiveLength { get; set; }

        public Stream ReceiveStream { get; set; }

        public DateTime ReceiveTime { get; set; }
    }
}

